<?php

namespace App\Jobs;

use Illuminate\Bus\Queueable;
use Illuminate\Queue\SerializesModels;
use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Foundation\Bus\Dispatchable;
use Illuminate\Support\Facades\DB;

class TestRabitmq implements ShouldQueue
{
    use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
    protected $brand;
    protected $openid;
    /**
     * Create a new job instance.
     *
     * @return void
     */
    public function __construct($brand,$openid)
    {
        $this->brand = $brand;
        $this->openid = $openid;
    }

    /**
     * Execute the job.
     *
     * @return void
     */
    public function handle()
    {
        DB::table('leave_messages')->insert([
            'brand' => $this->brand,
            'openid' => $this->openid,
            'user_comment_id' => 2,
            'comment_type' => 1,
            'content' => 'test',
            'create_time' => time(),
        ]);
    }
}
